package com.woniu.owner.controller;

import com.woniu.common.ResponseData;
import com.woniu.owner.entity.SmartUnlocking;
import com.woniu.owner.service.CommunityService;
import com.woniu.owner.service.HomeMenuService;
import com.woniu.owner.service.SmartUnlockingService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("/home")
@AllArgsConstructor
public class HomeController {
    private HomeMenuService homeMenuService;
    private SmartUnlockingService smartUnlockingService;

    /**
     * 查询首页功能模块
     *
     * @return
     */
    @GetMapping("/queryAllHomeMenu")
    public ResponseData<?> queryAllHomeMenu() {
        return homeMenuService.queryAllHomeMenu();
    }

    /**
     * 一键开门功能
     */
    @PostMapping("/unlock")
    public ResponseData<?> unlock(@RequestBody SmartUnlocking smartUnlocking) {
        return smartUnlockingService.unlock(smartUnlocking);
    }
}
